package springMVC.getParams.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.SessionAttribute;

import javax.servlet.http.HttpSession;

/**
 * @Author quan
 * @Description 设置session
 * @Date 2023/7/22 17:48
 */


@RestController
@RequestMapping("/web")
public class Demo10_SetSession {
    @RequestMapping("/set1")
    public String set1(HttpSession session){
        if(session !=null){
            session.setAttribute("username","小花花");

        }
        return "success";
    }
}
